#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool canPermutePalindrome(string s) {
        int count[128] = { 0 };
        for (auto c : s)
        {
            count[c]++;
        }
        if (0 == s.size() % 2)
        {
            for (int i = 0; i < 128; i++)
            {
                if (1 == count[i] % 2)
                    return false;
            }
            return true;
        }
        else
        {
            int odd = 0;
            for (int i = 0; i < 128; i++)
            {
                if (1 == count[i] % 2)
                    odd++;
            }
            if (1 == odd)
                return true;
            else
                return false;
        }
    }
};